name := "energy-saving-rc"

homepage := Some(url("http://code.google.com/p/energy-saving-rc"))

version := "1.0-SNAPSHOT"

organization := "com.typesafe.play"

scalaVersion := "2.10.2"

resolvers += Classpaths.sbtPluginReleases

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

resolvers += "Typesafe snapshots" at "http://repo.typesafe.com/typesafe/snapshots/"

scalacOptions += "-feature"

scalacOptions in (Compile, doc) ++= Opts.doc.title("Energy Saving Roadmap API") 

libraryDependencies ++= {
  val playVersion = "2.2.3"
  val slickVersion = "2.0.0"
  Seq(
	  "com.typesafe.play" %% "play" % playVersion,
    "com.typesafe.play" %% "play-jdbc" % "2.2.2",
	  "com.typesafe.slick" %% "slick" % slickVersion,
	  "com.typesafe.play" %% "play-slick" % "0.6.0.1",
	  "org.webjars" %% "webjars-play" % "2.2.1",
	  "org.webjars" % "jquery" % "1.9.0",
	  "org.webjars" % "bootstrap" % "3.1.1", 
	  "org.webjars" % "font-awesome" % "4.0.3-1",
	  "org.webjars" % "highcharts" % "3.0.9",
	  "org.webjars" % "x-editable-bootstrap3" % "1.5.1",
    "org.webjars" % "dustjs-linkedin" % "2.3.4",
    "postgresql" % "postgresql" % "9.1-901-1.jdbc4"
	)
}

play.Project.playScalaSettings

//  sbt scaladoc options
//  http://www.scala-sbt.org/0.13.2/docs/Howto/scaladoc.html
autoAPIMappings := true

apiMappings ++= {
  val cp: Seq[Attributed[File]] = (fullClasspath in Compile).value
  def findManagedDependency(organization: String, name: String): File = {
    ( for {
        entry <- cp
        module <- entry.get(moduleID.key)
        if module.organization == organization
        if module.name.startsWith(name)
        jarFile = entry.data
      } yield jarFile
    ).head
  }
  Map(
      findManagedDependency("com.typesafe.play", "play") -> url("http://www.playframework.com/documentation/2.2.x/api/scala/index.html/"),
      findManagedDependency("com.typesafe.slick", "slick") -> url("http://slick.typesafe.com/doc/2.0.2/api/")
  )
}
